﻿<loki:ViewControl
    xmlns:lunavm="clr-namespace:Luna.UI.CRM;assembly=Luna.Core"
    xmlns:loki="clr-namespace:Loki.UI.Wpf;assembly=Loki.UI.Wpf"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
    xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
    xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
    xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
    xmlns:local="clr-namespace:Luna.UI.Wpf"
    xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
    xmlns:Custom="http://schemas.devexpress.com/winfx/2008/xaml/grid/themekeys"
    x:TypeArguments="lunavm:CategoryListViewModel"
    x:Class="Luna.UI.CRM.Wpf.CategoryListView"
    mc:Ignorable="d"
    d:DesignHeight="500" d:DesignWidth="800">
    <Grid>
        <Grid.Resources>
            <local:ColorToSolidColorBrushValueConverter  x:Key="ColorToSolidColorBrush_ValueConverter" />
        </Grid.Resources>
        <dxg:GridControl ItemsSource="{Binding Categories}" x:Name="GRD_Categories">
            <dxg:GridControl.Columns>
                <dxg:GridColumn Header="Nom" x:Name="COL_Name" />
                <dxg:GridColumn Header="Description" x:Name="COL_Description" />
                <dxg:GridColumn Header="Couleur" x:Name="COL_Color">
                    <dxg:GridColumn.EditSettings>
                        <dxe:PopupColorEditSettings />
                    </dxg:GridColumn.EditSettings>
                </dxg:GridColumn>
            </dxg:GridControl.Columns>
            <dxg:GridControl.View>
                <dxg:TableView AutoWidth="True" x:Name="TBL_Categories" ShowGroupPanel="False" NewItemRowPosition="Top" RowStyle="{DynamicResource Style2}">
                    <dxg:TableView.Resources>
                        <Style x:Key="Style2" BasedOn="{StaticResource {Custom:GridRowThemeKey ResourceKey=RowStyle}}" TargetType="{x:Type dxg:GridRowContent}">
                            <Setter Property="Background" Value="{Binding Row.Color, Converter={StaticResource ColorToSolidColorBrush_ValueConverter}}" />
                        </Style>
                    </dxg:TableView.Resources>
                </dxg:TableView>
            </dxg:GridControl.View>
        </dxg:GridControl>
    </Grid>
</loki:ViewControl>